const path = require('path')
const { merge } = require('webpack-merge')
const commonConfig = require('./webpack.common.js')

developmentConfig = {
  mode: 'development',

  devtool: 'source-map',

  devServer: {
    contentBase: path.resolve(__dirname, "../dist"),
    // open: true,
    compress: true,
    port: 9000,
    historyApiFallback:true,
    proxy: {
      '/wxpay/prepay':{
        target: 'http://walter666.cn:3000',
        changeOrigin: true,
      },
      '/api': {
        target: 'http://localhost:8055',
        changeOrigin: true,  
        pathRewrite: {'^/api' : ''}
      },
      '/v1/thread/':{
        target: 'http://h5test.wfdata.club',
        changeOrigin: true,
      },
      '/v1/content/type/list':{
        target: 'http://h5test.wfdata.club',
        changeOrigin: true,
      },
    }
  }
}

module.exports = merge(commonConfig, developmentConfig)